home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1996
/
MacHack 1996.toast
/
Hacks
/
Hacks ’92
/
Text Capture FKEY
/
End_copy.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-06-12
|
1KB
|
51 lines
#include "defs.h"
#define CHECKPOINTS 0
#include "debug.h"
void End_copy( void )
{
WindowPtr kludge;
Rect kludge_bounds;
short save_kind;
EvQElPtr new_event;
CKPT("End_copy start");
/* Unpatch the StdText bottleneck. */
if (got_grafProcs)
{
DisposPtr( (Ptr)front->grafProcs );
front->grafProcs = NIL;
}
else
front->grafProcs->textProc = (ProcPtr) Old_StdText;
/*
Stick the text on the clipboard. Getting this to work in DA
windows, under both System 6 and 7, requires some trickery.
*/
(void) ZeroScrap();
TESetSelect( 0, 32767, text_h );
TECopy( text_h );
save_kind = ((WindowPeek)front)->windowKind;
((WindowPeek)front)->windowKind = 2;
SystemEdit( 3 );
((WindowPeek)front)->windowKind = save_kind;
/*
Fake an activate event to make the new scrap information be
adopted into a private scrap.
*/
if (fake_activate)
{
PPostEvent( activateEvt, (long) front, &new_event );
new_event->evtQModifiers = activeFlag;
}
/* Get rid of the TE structure and GrafPort. */
TEDispose( text_h );
ClosePort( text_port );
DisposePtr( (Ptr)text_port );
Unpatch();
CKPT("End_copy end");
}